package org.geom;

public class Point3D {

	public float x = 0;
	public float y = 0;
	public float z = 0;
	
	public Point3D() {}
	public Point3D(float x, float y, float z) {
		this.x = x;
		this.y = y;
		this.z = z;
	}
	
	public Point3D(double x, double y, double z) {
		this.x = (float) x;
		this.y = (float) y;
		this.z = (float) z;
	}
	
	public String toString() {
		return x+" - "+y+" - "+z;
	}
	
	public boolean equals(Point3D n) {
		if(n==null) return false;
		
		if(x==n.x && y==n.y && z==n.z) return true;
		else return false;
	}
	
	public Point3D duplicate() {
		Point3D p = new Point3D();
		p.x = x;
		p.y = y;
		p.z = z;
		
		return p;
	}
	
	public Point3D minus(Point3D n) {
		return new Point3D(this.x-n.x, 
				this.y-n.y,
				this.z-n.z);
	}
	
}
